<template>
	<view>
		<rankingTable 
			@itemClick="nextPage" 
			:columns="columns"  
			showIndex 
			isRanking 
			:dataList="dataList"
		></rankingTable>
	</view>
</template>

<script>
	import rankingTable from '../components/rankingTableItem.vue'
	export default {
		components:{rankingTable},
		data() {
			return {
				dataList:[
					{
						name:'张三1',
						grade:'一年级',
						word:'20',
						score:'100',
					},
					{
						name:'张三2',
						grade:'一年级',
						word:'20',
						score:'100',
					},
					{
						name:'张三3',
						grade:'一年级',
						word:'20',
						score:'100',
					},
					{
						name:'张三4',
						grade:'一年级',
						word:'20',
						score:'100',
					},
				],
				columns:[
					{
						type:'index',
						title:'名次',
						align:'center',
					},
					{
						title:'用户昵称',
						prop:'name',
						align:'center',
					},
					{
						title:'年级',
						prop:'grade',
						color:'#4D97FF',
						align:'center',
					},
					{
						title:'单词',
						prop:'word',
						align:'center',
					},
					{
						title:'成绩',
						prop:'score',
						align:'center'
					},
				]
			};
		},
		methods:{
			// 行点击
			nextPage(item){
				console.log(item);
			},
		}
	}
</script>

<style lang="less" scoped>
	page{
		width: 100%;
		background: #EEFAFF;
	}
	
	

</style>
